<template>

  <div>

    <Header :city="city"></Header>
    <Swiperswiper  :swiperer="swiperer"></Swiperswiper>
    <Icon :icon="icon"></Icon>
    <Recommend :recommend="recommend"></Recommend>
    <Wekend :wekend="wekend"></Wekend>


  </div>

</template>

<script>
  import Header from './components/Header'
  import Swiperswiper from './components/Swiper'
  import Icon from './components/Icon'
  import Recommend from './components/Recommend'
  import Wekend from './components/Wekend'
  import axios from 'axios'
    export default {
        name: "Home",
        components:{

          Header,Swiperswiper,Icon,Recommend,Wekend

          },
         data(){

          return{
            city:"",
            swiperer:[],
            icon:[],
            recommend:[],
            wekend:[]



          }


         },
         methods:{
           getHomeInfo(){

             axios.get('/api/index.json').then(this.getHomeInfoSucc)


           },
           getHomeInfoSucc(res){

             console.log(res)
             const data=res.data.data;
             this.city=data.city
             this.swiperer=data.swiperList
             this.icon=data.iconList
             this.recommend=data.recommendList
             this.wekend=data.weekendList

           }

         },
         mounted () {
                this.getHomeInfo()
         }



    }
</script>

<style scoped lang="stylus">







</style>
